Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Native Send Component #1874

Draft
wants to merge 82 commits into
base: main
Choose a base branch
from
Draft

feat: Native Send Component #1874

wants to merge 82 commits into from

Conversation

brendan-defi
Copy link
Contributor

What changed? Why?

Notes to reviewers

How has it been tested?

Copy link

vercel bot commented Jan 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
onchainkit-coverage ❌ Failed (Inspect) Feb 1, 2025 0:40am
onchainkit-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 0:40am
onchainkit-routes ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 1, 2025 0:40am

showSend,
setShowSend,
isSendClosing,
setIsSendClosing,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could probably simplify these, since you only ever show a single thing at a time, only really need a single isClosing and setIsClosing, probably possible to also have a single show: 'qr' | 'send' | 'swap' and setShow(type: 'qr' | 'send' | 'swap'), would make adding additional types easier.

const { tokenBalances } = useWalletAdvancedContext();
const context = useSendContext();

const walletHasEth = context.isInitialized && context.ethBalance > 0.000001;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 0.000001? may want to extract to a const, MIN_ETH_TO_SEND

setValidatedInput,
handleRecipientInputChange,
className,
}: AddressInputProps) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: SendAddressInputProps

selectedRecipientAddress: RecipientAddress;
recipientInput: string;
setRecipientInput: Dispatch<SetStateAction<string>>;
setValidatedInput: Dispatch<SetStateAction<RecipientAddress>>;
Copy link
Contributor

@alessey alessey Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the intention by passing props is to allow this to be reusable, would be better to make these standard callbacks vs. setState callbacks

inputMode="text"
placeholder="Basename, ENS, or Address"
value={displayValue}
inputValidator={() => !!validateAddressInput(recipientInput)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputValidator={(value) => !!validateAddressInput(value)}

cryptoAmount={cryptoAmount ?? ''}
exchangeRate={exchangeRate}
exchangeRateLoading={false}
currency={'USD'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: unnecessary {}

address: AddressType | null;
senderChain: Chain | null | undefined;
handleClick: () => Promise<void>;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

className?

fiatAmount={fiatAmount ?? ''}
cryptoAmount={cryptoAmount ?? ''}
asset={selectedToken?.symbol ?? ''}
currency={'USD'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: unnecessary {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants